import React, { Component } from 'react';
import S from './newConfirm.m.less';

export default class NewConfirm extends Component {
    static defaultProps = {
        title: '',
        contentOne: '',
        contentTwo: '',
        highlightContent: '',
        cancel: '取消',
        confirm: '确定',
        cancelCallback: () => {
            WPT.Modal.close(false);
        },
        confirmCallback: () => {
            WPT.Modal.close(false);
        },
    };

    render() {
        const {
            title,
            contentOne,
            contentTwo,
            highlightContent,
            cancel,
            confirm,
            cancelCallback,
            confirmCallback,
        } = this.props;
        return (
            <div className={S.confirmContainer}>
                <div className={S.top}>
                    <div className={S.title}>{title}</div>
                    <div className={S.content}>
                        {contentOne}
                        <div className={S.highlight}>{highlightContent}</div>
                        {contentTwo}
                    </div>
                </div>
                <div className={S.bottom}>
                    <div className={S.cancel} onClick={cancelCallback}>
                        {cancel}
                    </div>
                    <div className={S.confirm} onClick={confirmCallback}>
                        {confirm}
                    </div>
                </div>
            </div>
        );
    }
}
